Cross-ontology multi-master replication

ABSTRACT

A system and method providing cross-ontology multi-master replication is described. In a first embodiment a method for cross-ontology multi-master replication comprising the steps of: obtaining, at an importing site, an exporting site ontology and a set of one or more database changes; wherein the exporting site ontology defines a set of one or more data types; and after mapping the exporting site ontology to an importing site ontology, incorporating the set of one or more database changes into a database including mapping each of one or more data types of the set of data types to a data type defined by the importing site ontology using an ontology map.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application is related to the following commonly-owned,presently pending applications: application Ser. No. 12/836,801, filedJul. 15, 2010, entitled “Sharing and Deconflicting Data Changes in aMultimaster Database System” and application Ser. No. 11/602,626, filedNov. 20, 2006, entitled “Creating Data in a Data Store Using a DynamicOntology”. The disclosure of each of the foregoing applications ishereby incorporated by reference in its entirety, for all purposes.

TECHNICAL FIELD

The present disclosure generally relates to distributed computingsystems and, in particular, to cross-ontology data replication in amulti-master database system.

BACKGROUND

The approaches described in this section are approaches that could bepursued, but not necessarily approaches that have been previouslyconceived or pursued. Therefore, unless otherwise indicated, it shouldnot be assumed that any of the approaches described in this sectionqualify as prior art merely by virtue of their inclusion in thissection.

Multi-Master Database Systems

In a typical computer-based multi-master database system, data is storedin a group of databases, data changes may be made to any member of thegroup, and data changes made to one member are propagated to the rest ofthe group. Multi-master database systems typically employ either a“synchronous” or an “asynchronous” replication scheme for propagating achange made to one database to the rest of the databases in the group.

In typical synchronous multi-master replication, each change is appliedto all databases in the group immediately or to none of the databases ifone or more of the databases in the group cannot accept the change. Forexample, one of the databases may be offline or unavailable. Synchronousmulti-master replication is typically achieved using a two-phase commitprotocol.

In contrast, in typical asynchronous multi-master replication, a changemade to a database is immediately accepted by the database butpropagation of the change to other databases in the group may bedeferred. Because propagation of changes may be deferred, if one or moreof the databases in the group are unavailable, the available databasescan still accept changes, queuing the changes locally until they can bepropagated. For this reason, multi-master database systems employing anasynchronous replication strategy are generally considered to be morehighly available than multi-master database systems employing asynchronous replication strategy. However, asynchronous replicationoften raises the possibility of conflicts that occur as a result ofconcurrent database changes. In some circumstances, resolution of theseconflicts requires human intervention.

Database Ontologies in Multi-Master Database Systems

Each database system participating in a multi-master database systemtypically organizes data in the database it manages according to a fixedstructure and a well-defined set of data types. For example, arelational database management system typically organizes data accordingto a fixed structure of tables and columnar data types. The structureand data type definitions may be described using an ontology, embodiedin a database schema, comprising a data model that is used to representthe structure, define the data types, and reason about data objects inthe structure.

All database systems participating in a multi-master database systemnormally adhere to the same ontology. The ontology at each databasesystem is normally fixed at the time that the topology of themulti-master database system is established. Any change to an ontologyused by one database system that causes the ontology to diverge from theontologies used by the other database systems is typically extremelydisruptive to the multi-master database system and requires a databaseadministrator or a software programmer to create customized software tofacilitate data replication between the database system using thediverging ontology and the other database systems in the multi-masterdatabase system.

The rigidity of the typical fixed ontology multi-master database systemis a serious drawback for organizations that require flexible anddynamic data processing techniques according to changes in the data thatis collected. For example, intelligence analysis is poorly suited toconventional fixed ontology multi-master database systems.

SUMMARY

A system and method providing cross-ontology multi-master replication isdescribed. In a first embodiment a method for cross-ontologymulti-master replication comprising the steps of: obtaining, at animporting site, an exporting site ontology and a set of one or moredatabase changes; wherein the exporting site ontology defines a set ofone or more data types; and after mapping the exporting site ontology toan importing site ontology, incorporating the set of one or moredatabase changes into a database including mapping each of one or moredata types of the set of data types to a data type defined by theimporting site ontology using an ontology map.

In an aspect of the first embodiment, at least one database change ofthe set of one or more database changes comprises (a) a data itemrepresenting a change to a database copy at the exporting site and (b)data representing a data type of the data item according to theexporting site ontology.

In another aspect of the first embodiment, obtaining, at the importingsite, the exporting site ontology and the set of one or more databasechanges comprises obtaining, at the importing site, a database updatecomprising the exporting site ontology and the set of one or moredatabase changes.

In yet another aspect of the first embodiment, obtaining, at theimporting site, a digest of an ontology map at the exporting site;computing a digest of an ontology map at the importing site; andcomparing the obtained digest of the ontology map at the exporting sitewith the computed digest of the ontology map at the importing site.

In still yet another aspect of the first embodiment, at least one datatype of the set of one or more data types is not defined by theimporting site ontology.

In still yet another aspect of the first embodiment, the ontology mapcomprises a one-to-one mapping between a first particular data typedefined by the exporting site ontology and a second particular data typedefined by the importing site ontology; and wherein mapping each of theone or more data types of the set of data types to a data type definedby the importing site ontology using an ontology map comprises mappingthe first particular data type to the second particular data type usingthe ontology map.

In still yet another aspect of the first embodiment, the ontology mapcomprises a one-to-many mapping between a first particular data typedefined by the exporting site ontology and a plurality of data typesdefined by the importing site ontology; and wherein mapping each of theone or more data types of the set of data types to a data type definedby the importing site ontology using an ontology map comprises mappingthe first particular data type to one of the plurality of data typesdefined by the importing site ontology using the ontology map.

In still yet another aspect of the first embodiment, the ontology mapspecifies a list of data types to be dropped when exporting databasechanges from the exporting site.

In still yet another aspect of the first embodiment, the ontology mapcomprises a one-to-one mapping between a first particular link data typedefined by the exporting site ontology and a second particular link datatype defined by the importing site ontology; wherein the mapping furtherspecifies that a link represented by data of the first particular linkdata type should be reversed before data representing the link isincorporated into the database; and wherein incorporating the set of oneor more database changes into the database comprises reversing a linkrepresented by a particular database change of the set of databasechanges before incorporating the particular database change into thedatabase.

In a second embodiment, a method for cross-ontology multi-masterreplication comprising the steps of: obtaining, at an exporting site, animporting site ontology; obtaining a database change comprising aproperty value, the property value having a exporting site property typeas defined in an exporting site ontology; using an ontology map to mapthe exporting site property type to an importing site property typedefined in the importing site ontology; transforming the property valueto an intermediate property value based on the importing site propertytype; transforming the intermediate property value to a first round-tripvalue based on the exporting site property type; determining whether toexport the database change to the importing site based on a comparisonbetween the property value and the first round-trip value.

In an aspect of the second embodiment, determining to export thedatabase change to the importing site in response to determining thatthe property value and the first round-trip value are the same.

In another aspect of the second embodiment, determining that theproperty value and the first round-trip value are different;transforming the first round-trip value to a second intermediate valuebased on the importing site property type; transforming the secondintermediate value to a second round-trip value based on the exportingsite property type; and determining whether to export the databasechange to the importing site based on a comparison between firstround-trip value and the second round-trip value.

Other embodiments include, without limitation, a non-transitorycomputer-readable medium that includes processor-executable instructionsthat enable a processing unit to implement one or more aspects of thedisclosed methods as well as a system configured to implement one ormore aspects of the disclosed methods.

BRIEF DESCRIPTION OF DRAWINGS

The present invention is illustrated by way of example, and not by wayof limitation, in the figures of the accompanying drawings and in whichlike reference numerals refer to similar elements and in which:

FIG. 1 illustrates a multi-master replication system.

FIG. 2 illustrates an object-centric conceptual data model.

FIG. 3 illustrates a system for creating data in a database copy usingan ontology.

FIG. 4 illustrates exporting database changes using an ontology map.

FIG. 5 illustrates importing database changes using an ontology map.

FIG. 6 illustrates a database update.

FIG. 7 (consisting of FIGS. 7A and 7B) illustrates pre-export peerontology validation.

FIG. 8 illustrates a computer system with which an embodiment may beimplemented.

DETAILED DESCRIPTION

Introduction

Referring to the figures, example embodiments will now be described. Theexample embodiments are primarily described with reference to blockdiagrams or flowcharts. As to the flowcharts, each block within theflowcharts represents both a method step and an apparatus element forperforming the method step. Depending upon the implementation, thecorresponding apparatus element may be configured in hardware, software,firmware, or combinations thereof. For example, in an embodimentcomprising a special-purpose computer, an apparatus element may comprisea functional block of circuit logic.

Further, in the following description, for the purposes of explanation,numerous specific details are set forth in order to provide a thoroughunderstanding of the present invention. It will be apparent, however,that the present invention may be practiced without these specificdetails. In other instances, block diagrams include well-knownstructures and devices in order to avoid unnecessarily obscuring thepresent invention.

Multi-Master Database System with Ontology Mapping

FIG. 1 illustrates a multi-master database system 100 for use incross-ontology multi-master replication between two replication sites101 and 102. In one embodiment, sites 101 and 102 are coupled throughone or more data networks such as the Internet, one or more wide areanetworks (WANs), one or more local area networks (LANs), one or morenetwork communication buses, or some combination thereof. It is notnecessary that a highly or continuously available data network existbetween replication sites 101 and 102 and the data network(s) connectingany two sites may only be periodically available. In another embodiment,sites 101 and 102 are not connected to each other via a data network anddata is transported between these sites manually using portable media ora portable media device as such as a Compact Disc (CD), a DigitalVersatile Disc (DVD), Universal Serial Bus (USB) flash memory device,etc.

Each site 101 and 102 may comprise one or more computing devices such asone or more workstation computers, server computers, laptop computers,mobile computing devices, or combinations thereof connected to eachother via one or more data networks. Further, while only two sites areshown in FIG. 1, multi-master database system 100 may comprise manyhundreds or even many thousands of sites.

According to one embodiment, each site (101, 102) has a copy (103, 104)of a body of data. The body of data may be, for example, one or moretables in a relational database. However, embodiments are not limited torelational databases and any type of database capable of supporting theconceptual data model described herein may be used. Non-limitingexamples of types of databases capable of supporting the conceptual datamodel described herein include relational databases, hierarchicaldatabases, and object-oriented databases.

With respect to a particular body of data, site 101 may be configured toasynchronously propagate to site 102 changes made to database copy 103.Similarly, site 102 may be configured to asynchronously propagate tosite 101 changes made to database copy 104. With regard to multi-masterreplication, sites 101 and 102 may be considered to be replication“peers” because they share database changes directly with each otherwithout sharing changes through an intermediary site. It is notnecessary that each site (101, 102, etc.) in the system 100 isconfigured to propagate to every other site changes made to its copy. Inother words, a full-meshed multi-master site topology is not required toimplement embodiments and partially-meshed or cascading multi-mastertopologies may be used.

As system 100 employs an asynchronous replication scheme, databasecopies in the system 100 are eventually consistent with each other. Thatis, each database copy may diverge from other copies from time to timesuch that at any given moment one database copy is inconsistent withanother database copy. Two database copies are inconsistent when onedatabase copy has incorporated a change and the other database copy hasnot yet been notified of the change. In the absence of new changes toeither database copy, the database copies are expected to eventuallybecome consistent with one another. Note that consistent database copiesdo not necessarily mean identical database copies. Indeed, since twodatabase copies might use different ontologies, it is expected that twodatabase copies can be consistent but not identical. For example, bothdatabase copies 103 and 104 might separately contain a data objectrepresenting the same real world entity such as, for example, the sameperson; however, under the ontology 105 of database copy 103 the dataobject may have the data type “Person” while under the ontology 106 ofdatabase copy 104 the data object may have the data type “Human”.

Each site in the system 100 has import/export logic 120 that includes across-ontology multi-master replication feature. In an embodiment, thecross-ontology multi-master replication feature can function to map datatypes defined by a peer site's ontology (e.g., ontology 106) to datatypes defined by the local site's ontology (e.g., ontology 105) wherethe two peer ontologies do not define identical data types (i.e., wherethe two peer ontologies differ) using an ontology map 110. In anembodiment, the ontology map 110 fills the gaps between the two peerontologies 105 and 106 such that sites 101 and 102 are still able toshare database changes with each other despite using differentontologies. Specific techniques for cross-ontology multi-masterreplication using an ontology map are described in greater detail below.

The import/export logic 120 may be implemented as one or more computersoftware programs, one or more field programmable logics, hard-wiredlogic, or a combination thereof. In one embodiment, import/export logic120 is a software component of a database management system such as anopen source database system such as Cassandra, or those commerciallyavailable from the Oracle Corporation of Redwood Shores, Calif. and theMicrosoft Corporation of Redmond, Wash. In another embodiment,import/export logic 120 is software component of a web-based,server-based or desktop application that uses a database managementsystem for performing the cross-ontology multi-master replicationtechniques described herein. In yet another embodiment, import/exportlogic 120 is implemented in part by a web-based, server-based or desktopapplication and in part by a database management system.

As used herein, the term “database change”, unless otherwise apparentfrom the surrounding text, refers to an addition, edit, or deletion tothe body of data stored in a database copy (e.g., copy 103) at a site. Adatabase change can be made at the site by a user or a computingprocess. In addition, a database change can also be made byimport/export logic 120 in response to receiving notification of adatabase change made to a database copy at a peer site.

As used herein, the term “database update”, unless otherwise apparentfrom the surrounding text, refers to information about a database changethat is sent (exported) from the site that made the change to a peersite. Each database change to a database copy at a site may result in adatabase update being received at every other site in the multi-mastertopology so that the other sites can incorporate the change into theirrespective database copies. The site sending a database update isreferred to herein as the “exporting” peer and the site incorporatingthe sent database update is referred to herein as the “importing” peer.For example, if site 101 sends a database update to site 102, then site101 is the exporting peer and site 102 is the importing peer.

In one embodiment, a database update is sent from the exporting peeraccording to the exporting site's ontology. When the database update isreceived at the importing peer, the importing peer maps any of theexporting peer's data types that are not defined by the importing peer'sontology using an ontology map configured at the importing peer. Afterthis cross-ontology data-type mapping is complete, the importing peerincorporates the database update into its database copy, mapping datatypes between the exporting peer's ontology and the importing peer'sontology using the ontology map as necessary. Notably, the data of thedatabase update as incorporated into the incorporating peer's databasecopy is data typed according to the importing peer's ontology eventhough the data as exported by the exporting peer was data typedaccording to the exporting peer's ontology.

Example Database Data Model and Example Database System Using anOntology to Make Database Changes

To provide a framework for the following discussion of specifictechniques for cross-ontology multi-master replication, an exampledatabase data model and an example database system using an ontology tomake database changes to the system's database copy will now bedescribed. This description is provided for the purpose of providing aclear example and is not intended to limit the techniques to the exampledata model, the example database system, or the example databasesystem's use of an ontology to make database changes.

Example Object-Centric Data Model

In one embodiment, a body of data, of which each site (101, 102, etc.)maintains a copy (103, 104, etc.), is conceptually structured accordingto an object-centric data model. The conceptual data model isindependent of any particular database data model that may be used fordurably storing a database copy at a site. For example, each object ofthe conceptual data model may correspond to one or more rows in arelational database or an entry in Lightweight Directory Access Protocol(LDAP) database.

FIG. 2 illustrates an object-centric conceptual data model 200 accordingto an embodiment. Model 200 is centered on a data object 201. At thehighest level of abstraction, data object 201 is a container forinformation representing things in the world. For example, data object201 can represent an entity such as a person, a place, an organization,or other noun. Data object 201 can represent an event that happens at apoint in time or for a duration. Data object 201 can represent adocument or other unstructured data source such as an e-mail message, anews report, or a written paper or article. Each data object 201 isassociated with a unique identifier that uniquely identifies the dataobject within system 100.

Each data object 201 as represented by data in a database copy (103,104, etc.) at a site (101, 102, etc.) may have an object type (e.g.,Person, Event, or Document) defined by the database ontology (105, 106,etc.) used by the database copy (103, 104, etc.). The same data objectrepresented in two different database copies (e.g., 103, 104) may havetwo different object types as separately defined by the two differentdatabase ontologies (e.g., 105, 106). For example, the same data objectin one database copy (e.g., 103) may be defined as a “Business” objecttype while defined in another database copy (e.g., 104) as an“Organization” object type. Further, when hierarchical object types aresupported, two ontologies may separately define super-object types andsub-object types of the super-object types. For example, one ontologymay define a “Person” super-object type an additionally define an“Employee” sub-object type of the “Person” super-object type. On theother hand, the other ontology may define only the “Person” object typebut not define the “Employee” object type. In this case, the same dataobject in one database copy may be defined as object type “Employee”while defined in the other database copy as object type “Person”.

Each data object 201 may have one or more properties 203. Properties 203are attributes of the data object 201 that represent individual dataitems. At a minimum, each property 203 of a data object 201 has aproperty type and a value. Different types of data objects may havedifferent property types. For example, a “Person” data object might havean “Eye Color” property type and an “Event” data object might have a“Date” property type.

Each property 203 as represented by data in a database copy (e.g., 104)at a site (e.g., 102) may have a property type defined by the databaseontology (e.g., 106) used by the database copy. The same propertyrepresented in two different database copies may have two differentproperty types as separately defined by the two different databaseontologies. For example, the same property in one database copy may bedefined by that copy's ontology as a “Phone Number” property type inwhich the value of the property is treated as a string data type whiledefined by the other ontology also as a “Phone Number” property type butwhere the value of the property is treated as a numerical data type.

In addition, data model 200 may support property multiplicity. Inparticular, a data object 201 may be allowed to have more than oneproperty 203 of the same property type. For example, a “Person” dataobject might have multiple “Address” properties or multiple “Name”properties.

Each link 202 represents a connection between two data objects 201. Inone embodiment, the connection is either through a relationship, anevent, or through matching properties. A relationship connection may beasymmetrical or symmetrical. For example, “Person” data object A may beconnected to “Person” data object B by a “Child Of” relationship (where“Person” data object B has an asymmetric “Parent Of” relationship to“Person” data object A), a “Kin Of” symmetric relationship to “Person”data object C, and an asymmetric “Member Of” relationship to“Organization” data object X. The type of relationship between two dataobjects may vary depending on the types of the data objects. Forexample, “Person” data object A may have an “Appears In” relationshipwith “Document” data object Y or have a “Participate In” relationshipwith “Event” data object E. As an example of an event connection, two“Person” data objects may be connected by an “Airline Flight” dataobject representing a particular airline flight if they traveledtogether on that flight, or by a “Meeting” data object representing aparticular meeting if they both attended that meeting. In oneembodiment, when two data objects are connected by an event, they arealso connected by relationships, in which each object has a specificrelationship to the event, such as, for example, an “Appears In”relationship. As an example of a matching properties connection, two“Person” data objects representing a brother and a sister, may both havean “Address” property that indicates where they live. If the brother andthe sister live in the same home, then their “Address” properties likelycontain similar, if not identical information. In one embodiment, a linkbetween two data objects may be established based on similar or matchingproperties of the data objects. These are just some examples of thetypes of connections that may be represented by a link and other typesof connections may be represented; embodiments are not limited to anyparticular types of connections between data objects. For example, adocument might contain two different tagged entities. A link between twodata objects may represent a connection between these two entitiesthrough their co-occurrence within the same document.

Each data object 201 can have multiple links with another data object201 to form a link set 204. For example, two “Person” data objectsrepresenting a husband and a wife could be linked through a “Spouse Of”relationship, a matching property (“Address”), and an event (“Wedding”).

Each link 202 as represented by data in a database copy (e.g., 104) at asite (e.g., 102) may have a link type defined by the database ontology(e.g., 106) used by the database copy. The same link represented in twodifferent database copies may have two different property types asseparately defined by the two different database ontologies. Forexample, the same link in one database copy may be defined by thatcopy's ontology as a “Related To” link type while defined by the otherontology as a “Parent Of” link type. Further, two ontologies mayseparately define opposite asymmetric link types. For example, oneontology may define a “Parent Of” link type but not define a “Child Of”link type while the other ontology may define a “Child Of” link type butnot define a “Parent Of” link type. In this case, the directions oflinks linking the same two data objects may be different in differentdatabase copies. For example, in one database copy, a “Parent Of” linkmay “point” from data object A to data object B while in anotherdatabase copy a “Child Of” link may “point” from data object B to dataobject A.

Example Database System Using an Ontology to Make Database Changes tothe System's Database Copy

FIG. 3 illustrates example components of a database system at a site forcreating data in a database copy (i.e., making database changes to thecopy) at the site using the database copy's ontology. In the exampledepicted in FIG. 3, the components are of the database system at site101 of multi-master replication system 100. Similar components may bepart of the database system at site 102 and at other sites of the system100. The ontology 105 at site 101 may be different than the ontology 106at site 102; thus one or more of object types 310, property types 316,and link types 330 may be defined in one ontology (e.g., 105) that arenot defined in the other ontology (e.g., 106), and the converse alsocould be implemented.

In an embodiment, a parser 302 is coupled to the ontology 105, which iscoupled to the database copy 103. In an embodiment, ontology 105comprises stored information providing the data model 200 of data storedin database copy 103, and the ontology is defined by one or more objecttypes 310, one or more property types 316, and one or more link types330. One or more data objects 201 in the database copy 103 may beinstantiated based on the object types 310, and each of the objects 201has one or more properties 203 that are instantiated based on propertytypes 316. Two data objects 201 may be connected by one or more links202 that may be instantiated based on link types 330. The property types316 each may comprise one or more components 318, such as a string,number, etc. Property types 316 may be instantiated based on a baseproperty type 320. For example, a base property type 320 may be“Locations” and a property type 316 may be “Home.”

In an embodiment, a user of the system uses an object type editor 324 tocreate the object types 310 and define attributes of the object types.In an embodiment, a user of the system uses a property type editor 326to create the property types 316 and define attributes of the propertytypes. In an embodiment, a user of the system uses link type editor 328to create the link types 330. Alternatively, other programs, processes,or programmatic controls may be used to create link types and propertytypes and define attributes, and using editors is not required.

In an embodiment, creating a property type 316 using the property typeeditor 326 involves defining at least one parser definition using aparser editor 322. A parser definition comprises metadata that informsparser 302 how to parse input data 300 to determine whether values inthe input data can be assigned to the property type 316 that isassociated with the parser definition. In an embodiment, each parserdefinition may comprise a regular expression parser 304A or a codemodule parser 304B. In other embodiments, other kinds of parserdefinitions may be provided using scripts or other programmaticelements. The elements of a regular expression parser 304A and a codemodule parser 304B are described further in subsequent sections. Oncedefined, both a regular expression parser 304A and a code module parser304B can provide input to parser 302 to control parsing of input data300.

In one embodiment of using the system of FIG. 3, input data 300 isprovided to parser 302. An object-property mapping for the input data300 enables the parser to determine which object type 310 should receivedata from a record of the input data, and which property types 316should receive data from individual field values in the input data.Based on the object-property mapping 301, the parser 302 selects one ofthe parser definitions that is associated with a property type in theinput data. The parser parses an input data field using the selectedparser definition, resulting in creating modified data 303. The modifieddata 303 is added to the database copy 103 according to ontology 105 bystoring values of the modified data in a property of the specifiedproperty type. As a result, input data 300 having varying format orsyntax can be created in database copy 103. The ontology 105 may bemodified at any time using object type editor 324, property type editor326, and link type editor 328, or under program control without humanuse of an editor. Parser editor 322 enables creating multiple parserdefinitions that can successfully parse input data 300 having varyingformat or syntax and determine which property types should be used totransform input data 300 into modified input data 303.

Cross-Ontology Exporting and Importing of Database Changes

FIG. 4 illustrates steps of a method 400 for exporting database changesfrom one database copy at one site in a multi-master replicationtopology to a peer site in the multi-master replication topology. FIG. 5illustrates steps of a method 500 for importing the database changes atthe peer site. For the purpose of providing a clear example, referencewill be made to the multi-master system 100 of FIG. 1 in which site 101is considered to be the exporting peer and site 102 is considered to bethe importing peer. Alternatively, site 102 could be the exporting peerand site 101 the importing peer.

Ontology 105 of the exporting peer 101 may be different than theontology 106 of the importing peer 102. That is, the ontology 105 of theexporting peer 101 may define one or more data types that are notdefined by the ontology 106 of the importing peer 106 and the ontology106 of the importing peer 102 may define one or more data types that arenot defined by the ontology 105 of the exporting peer 101. In thiscontext, the exporting peer 101 may wish to share database changes itmade to its database copy 103 with the importing peer 102 and theimporting peer 102 may wish to incorporate the shared database changesinto its database copy 104 even though the peers use differentontologies.

In one embodiment, to accomplish cross-ontology sharing of databasechanges, both the exporting peer 101 and the importing peer 102 areconfigured with the semantically same ontology map 110. In one aspect,the ontology map 110 declares rules for mapping data types defined inone site's ontology to data types defined in another site's ontology andvice versa to facilitate sharing of data between the sites yet at thesame time facilitating maintenance and development of separateontologies at the sites. Separate and differing ontologies at the sitesmay be desirous, for example, if the sites are controlled by differententities such as different companies or different organizations ordifferent divisions within an organization. With the ontology map, twosites that wish to share data with each other do not need to agree on acommon ontology. They need only agree on how to map data types betweenthe ontologies. As a result, if one site changes the type of an object,link, or property to one that it is not known to the peer site'sontology, the type change can still be shared with the peer site so longas the ontology map provides a rule for mapping the type to one that isknown to the peer site's ontology.

In one embodiment, the data format of the ontology map 110 and thecross-ontology data type mapping rules contained therein is based on theeXtensible Markup Language (XML). Specific examples of mapping rules areprovided below. The examples are provided in XML format. However, itwill be apparent to one skilled in the art that other data formats forexpressing the ontology map 110 in a form understandable by a computerare possible and that the invention is not limited to only XML-basedformats. In one embodiment, the ontology map 110 is created by adatabase administrator by using, for example, a text editor or computerapplication configured to generate ontology maps according to a user'scommands.

Exporting

Referring now to FIG. 4, in one embodiment, process 400 is performed bythe import/export logic 120 of the exporting peer 101 after theexporting peer 101 has been configured with the ontology map 110. Atstep 401, the exporting peer 101 determines a set of database changesmade to the exporting peer's database copy 103 to share with theimporting peer 102. The specifics of how the exporting peer 101determines the set of database changes to be shared are beyond the scopeof this disclosure and not essential to the invention disclosed herein.In general, it is expected, but not required, that the set of databasechanges will include data representing changes made to the body of datain the exporting peer's database copy 103 that are not yet known to theimporting peer 102. Any number of a variety of techniques for trackingthe ordering of events in a distributed system may be used to determinewhether the importing peer already knows about changes made to theexporting peer's copy 103 including, for example, use of vector clocks.Significantly, the set of database changes to be shared by the exportingpeer 101 is data typed according to the exporting peer's ontology 105.For example, the set of database changes may include data representingone or more data objects 201, properties 203, and links 202 typedaccording object types 310, property types 316, and link types 330defined in the exporting peer's ontology 105.

At step 402, one or more database changes in the set of database changesto be shared that may not be importable at the importing site 102 aredropped from the set by the exporting peer 101 before the set is sharedwith the importing peer 102. A database change may not be importable atthe importing peer 102 if the database change has a data type accordingto the exporting peer's ontology 105 that is not defined by theimporting peer's ontology 106 and for which the ontology map 110 doesnot provide a rule for mapping that data type to a data type in theimporting peer's 106 ontology. For example, an administrator at theexporting peer 101 may define a new data type in the ontology 105 forwhich the administrator has yet to decide how the new data type shouldbe mapped to the importing peer's ontology 106.

In one embodiment, the ontology map 110 specifies the list of data typesto be dropped by the exporting peer 101 when exporting a set of databasechanges. This list can be added to or amended as needed by anadministrator at the exporting peer 101. Before the import/export logic120 of the exporting peer 101 shares a set of database changes with theimporting peer 102, the logic 120 removes all database changes from theset that have a data type on the list of data types to be dropped. As aresult, sharing of database changes for which no corresponding data typeis defined in the importing peer's ontology 106 is prevented. Thisprevents errors and failures at the importing peer when importing theset of database changes. Further, this allows the ontology 105 of theexporting peer 101 to be extended (i.e., new types added) before it hasbeen determined how the new types will map to data types in the ontology106 of the importing peer 102. Meanwhile, sharing of database changesbetween the peers with respect to other data types can continue.

In accordance with an embodiment, the list of data types to be droppedby the exporting peer 101 when exporting a set of database changes isspecified in the ontology map 110 using the following XML syntax:

<droppedUri>

<systemId>SYSTEM_ID</systemId>

<uri>URI1</uri>

</droppedUri>

<droppedUri>

<systemId>SYSTEM_ID</systemId>

<uri>URI2</uri>

</droppedUri>

. . .

<droppedUri>

<systemId>SYSTEM_ID</systemId>

<uri>URIN</uri>

</droppedUri>

The <droppedUri> element contains a data type to drop on export. The<systemId> element contains a value SYSTEM_ID that identifies the sitethat is to drop the listed data type when exporting. An ontology map 110can specify multiple drop data types lists for multiple sites. Forexample, ontology map 110 may specify a drop data types list for site101 and another drop data types list for site 102. Each site separatelyconsults its list in the map 110 when exporting a set of databasechanges. Each data type to be dropped is identified as a value of a<uri> element. In one embodiment, the value of a <uri> element is aUniform Resource Indicator (URI) that uniquely identifies the data typewithin the exporting site's ontology. Dropped types can include objecttypes, property types, and link types, for example.

At step 403, the set of database changes minus the database changesdropped in step 402 are sent from the exporting site 101 as a databaseupdate to the importing site 102. FIG. 6 is a block diagram andschematic illustration of a database update 601 sent from the exportingsite 101 to the importing site 102 according to an embodiment. In oneembodiment, database update 601 is XML formatted and sent betweenexporting site 101 and importing site 102 over a data network as one ormore network data packets.

In accordance with one embodiment, database update 601 comprises a setof database changes 620 and database update metadata 610. In oneembodiment, the database update metadata 610 includes an ontology 611,an ontology map 612, and a digest 613 of the ontology map 612. Theontology 611 includes the ontology 105 of the exporting peer 101 or aportion thereof. The ontology map 612 includes the ontology map 110 asconfigured at the exporting peer 101. In one embodiment, the update 601includes one or the other of the ontology map 612 and the digest 613 butnot both.

The set of database changes 620 includes one or more update items 621A,621B, etc. Each update item 621 includes data 631 representing adatabase change to the exporting site's database copy 103, typeinformation 632 specifying the data type of data 631 according to theexporting site's ontology 105, and version information 633 indicatingthe version of data 631 in the exporting site's database copy 103. Forexample, data 631 may represent a database change to a data object 201,a property 203, or a link 202; type information 632 may specify a objecttype 310, a property type 316, or a link type 330; and the versioninformation 633 may be, for example, a vector clock representing theversion of the data object 201, the property 203, or the link 202 in theexporting peer's database copy 103.

In one embodiment, as described in greater detail below with respect toFIG. 5, the database update metadata 610 is used by the import/exportlogic 120 of the importing peer 102 when importing the set of databasechanges 620 into the importing peer's database copy 104. Briefly, theimporting peer 102, before importing any of the database changes 620into its database copy 104, verifies that every data type in theexporting peer's ontology 611 as sent in the update 601 has acorresponding data type in the importing peer's ontology 106. Thisverification includes, in one embodiment, the importing peer 102computing a digest of its copy of the ontology map 110 and comparing thecomputed digest to the digest 613 in the update metadata 610 to verifythat the exporting peer 101 and the importing peer 102 are configuredwith compatible ontology maps. Once the ontology maps 110 at peers 101and 102 are verified to be compatible, the importing peer 101 attemptsto map every data type defined in the exporting peer's ontology 611 to atype defined in the importing peer's ontology 106. If there is no directmapping available for a type defined in the ontology 611 (i.e., the typeis defined by the exporting peer's ontology 611 but not defined theimporting peer's ontology 106), then the importing peer 102 attempts tomap the type using a rule or rules in the ontology map 110. Assumingeach and every type in the exporting peer's ontology 611 can besuccessfully mapped to a type in the importing peer's ontology 106, theimporting peer 102 proceeds to import the database changes 620 in theupdate 601 into the importing peer's database copy 104, mapping datatypes 632 using the ontology map 110 as necessary.

In some embodiments, in the context of configuring the exporting peer101 with a new ontology map that is semantically different than theontology map that the exporting peer 101 is concurrently configuredwith, the import/export logic 120 performs a validation process withrespect to the new ontology map and the current ontology map. Thisprocess involves identifying mapping differences between the currentontology map and the new ontology map and notifying a user of potentialinconsistencies that could result from the mapping differences. Themapping differences of concern of those in which the new ontology mapchanges a mapping for data that may have already been exported orimported under the current ontology map. In this case, when anadministrator configures the exporting peer 101 with the new ontologymap, the administrator is notified about data that may have beenexported or imported under the current ontology map having a data typethat is now inconsistent with the new ontology map.

For example, suppose the current ontology map used by two peers has amapping in which object type A is mapped to object type B (A→B) andobject type C is mapped to object type D (C→D). Under this mapping, whenan object of type A is exported from a first of the two peers to asecond of the two peers, object type A is mapped to object type B at thesecond peer. And when an object of object type B is exported from thesecond peer to the first peer, object type B is mapped to object type Aat the first peer. Similarly, under this mapping when an object of typeC is exported from the first peer to the second peer, object type C ismapped to object type D at the second peer. And when an object of objecttype D is exported from the second peer to the first peer, object type Dis mapped to object type C at the first peer.

Continuing the example, now assume an administrator wishes to replacethe current ontology map at the two peers with a new ontology map inwhich object type A is mapped to object type D (A→D) and object type Cis mapped to object type B (C→B). The administrator may wish to do this,for example, after realizing that the current ontology map incorrectlymapped A to B and C to D. Under this new mapping, when an object of typeA is exported from the first peer to the second peer, object type A ismapped to object type D at the second peer. And when an object of objecttype D is exported from the second peer to the first peer, object type Dis mapped to object type A at the first peer. Similarly, for objecttypes C and B. If database changes had been exported and importedbetween the two peers under the current ontology map, then there may beobjects of type A in the first peer's database that should of type Cunder the new ontology map and there may be objects of type B in thesecond peer's database that should be of type D under the new ontologymap. In this case, in the context of an administrator configuring thefirst peer with the new ontology map, the import/export logic 102 at thefirst peer detects that object type A is remapped from B to D and objecttype C is remapped from D to B and notifies the administrator through ascreen or console message of the potential data type inconsistenciesthat may exist for objects of type A in the first peer's database andobjects of type B in the second peer's database.

Importing

Referring now to FIG. 5, in one embodiment, process 500 is performed bythe import/export logic 120 of the importing peer 102. At step 501, theimporting peer 102 obtains the exporting peer ontology 611 and a set ofdatabase changes 620. For example, the importing peer 102 may obtain theexporting peer ontology 611 and the set of database changes 620 in adatabase update 601 sent from the exporting peer. In one embodiment, theimporting peer 102 obtains the exporting peer ontology 611 and the setof database changes 620 in a plurality of database updates 601. Forexample, the exporting peer ontology 611 may be sent by the exportingpeer in an initial database update 601 and the set of database changes620 sent in a subsequent database update 601. Thus, it is notrequirement that every database update 601 include both the exportingpeer ontology 611 along with a set of database changes 620 and somedatabase updates 601 may include one but not the other.

The portion of the exporting peer ontology 611 sent in an update 601 mayor may not comprise the entire ontology 105 used by the exporting peer.In one embodiment, the exporting peer ontology 611 comprises at leastthe data types 632 involved in an associated set of database changes620.

At step 502, the importing peer 102 verifies that the ontology map 110at the exporting peer 101 is compatible with the ontology map 110 at theimporting peer 102. In one embodiment, this verification involves theimport/export logic 120 of the importing peer 102 computing a digest ofthe ontology map 110 at the importing peer 102 to compare with thedigest 613 in the database update 601 containing the set of databasechanges 620. In one embodiment, if the digests match, then the importingpeer 102 concludes that the ontology maps 110 at the exporting peer 101and the importing peer 102 are compatible. If the digests do not match,then, in one embodiment, the importing peer 102 assumes that theexporting peer 101 and the importing peer 102 are configured withincompatible ontology maps 110. Accordingly, the importing peer 102 inthis case may not import the set of database changes 620 into theimporting peer's database copy 104. In one embodiment, the digestcomputed by the importing peer 102 and the digest 613 computed by theexporting peer are computed using a collision resistant cryptographichash function (e.g., MD5). The ontology map may be normalized prior tobeing provided to the hash function so that trivial differences betweenontology maps do not produce differing digests.

In an embodiment in which the exporting peer's ontology map 110 is sentin the update 601 in lieu of a digest 613, the importing peer 102compares the exporting peer's ontology map 110 with its copy of theontology map 110 to determine if the two copies are compatible. Suchcomparison may involve a byte level comparison or comparisons at asemantically higher-level.

At step 503, the importing peer 102 attempts to map each and every typedefined in the exporting peer's ontology 611 sent in the update 601 to adata type defined in the importing peer's ontology 106. In oneembodiment, the importing peer 102 performs this mapping beforeimporting the set of database changes 120 into the importing peer'sdatabase copy 104. By successfully mapping each and every type definedin the exporting peer's ontology 611 sent in the update 601 to a datatype defined in the importing peer's ontology 106, the importing peer102 can import the set of database changes 620 with no risk of an importerror caused by a data type 632 of the set 602 that has no mapping to adata type in the importing peer's ontology 106.

A data type defined in the exporting peer's ontology 611 is or is notalso defined in the importing peer's ontology 106. If the data type isalso defined in the importing peer's ontology 106, then the ontology map110 is not needed to map the data type when importing data 631 of thatdata type. On the other hand, if the data type is not defined in theimporting peer's ontology 106, then the importing peer 102 uses a ruleor rules in the ontology map 110 in an attempt to map the data type toone defined in the importing peer's ontology 106. Example mapping rulesare described in greater detail below.

At step 504, after verifying that each data type defined in theexporting peer's ontology 611 can be mapped to a data type in theimporting peer's ontology 106, the importing peer 102 imports the set ofdatabase changes 620 into the importing peer's database copy 104. Thisimporting includes mapping data types 632 of data 631 in the set ofdatabase changes 620 to data types in the importing peer's ontology 106.Recall that the data types 632 specified in the update 601 are definedaccording to the exporting peer's ontology 105, some of which may notalso be defined in the importing peer's ontology 106. For these datatypes that are not defined in both the exporting peer's ontology 105 andthe importing peer's ontology 106, the ontology map 110 is used by theimporting peer during import of the update 601 to map these data typesfrom the exporting peer's ontology 105 to the importing peer's ontology106. As a result, all data 631 of the update 601 imported into theimporting peer's database copy 104 is typed according to the importingpeer's ontology 106 even though that data 631, when sent in the update601, was typed according to the exporting peer's ontology 106. Both theexporting peer 101 and the importing peer 102 can separately maintaindiffering ontologies yet still share data with each other as part of areplication scheme through the ontology map.

Ontology Map Examples

As described above with respect to an embodiment, the exporting peer101, when exporting a set of database changes, exports the data types ofdata included in the set of database changes (e.g., objects, properties,and links) as the data is typed in the exporting peer's database copy103 (i.e., according to the exporting peer's ontology 105). The ontologymap 110 can specify certain data types in the exporting peer's ontology105 that are to be dropped during export (i.e., no data of those typesis included in the exported data). This drop feature can be used toprevent the exporting peer 101 from sharing database changes that cannotbe representing according to the importing peer's ontology 106.

The importing peer 102, when importing a set of database changes, beginswith the data types of the data in the set of database changes as theyare defined by the exporting peer 101 according to the exporting peer'sontology 105. One or more of these data types may not be defined in theimporting peer's ontology 106. The ontology map 110 is used by theimporting peer to map these data types to ones defined in the importingpeer's ontology 106. In one embodiment, an ontology map 1110 can specifypairs of data types that map to each other (one-to-one mapping),parent-child relationships (one-to-many mappings), and a list of datatypes to drop on export.

Peer Information Section

In one embodiment, an ontology map 110 includes a peer informationsection. The peer information section comprises two system identifiersidentifying two sites (e.g., 101 and 102) configured in a peeringrelationship (i.e., two sites configured to share database changes witheach other as part of a multi-master replication topology). When a site(e.g., 101, 102, etc.) is configured with an ontology map 110, the peerinformation section is read to verify that the ontology map 110 appliesto the site being configured. During configuration of a site (Site A)with an ontology map 110, if one of the system identifiers in the peerinformation section identifies the site being configured with theontology map 110 (i.e., identifies Site A), then the site (Site A)verifies that the other system identifier in the peer informationsection identifies a site (Site B) that the configuring site (Site A) isconfigured to share database changes with. If both these conditions aremet, then the ontology map 110 applies to the configuring site (Site A).The other site (Site B) performs a similar process to determine if anontology map 110 it is being configured with applies to it.

In accordance with an embodiment, the peer information section isspecified in the ontology map as follows:

<peerInformation>

<systemId>SYSTEM_ID1</systemId>

<systemId>SYSTEM_ID2</systemId>

</peerInformation>

Dropped Types

In one embodiment, the ontology map 110 specifies the list of data typesto be dropped by the exporting peer 101 when exporting a set of databasechanges. This list can be added to or amended as needed by anadministrator at the exporting peer 101. Before the import/export logic120 of the exporting peer 101 shares a set of database changes with theimporting peer 102, the logic 120 removes all database changes from theset that have a data type on the list of data types to be dropped. As aresult, sharing of database changes for which no corresponding data typeis defined in the importing peer's ontology 106 is prevented. Thisprevents errors and failures at the importing peer when importing theset of database changes. Further, this allows the ontology 105 of theexporting peer 101 to be extended (i.e., new types added) before it hasbeen determined how the new types will map to data types in the ontology106 of the importing peer 102. Meanwhile, sharing of database changesbetween the peers with respect to other data types can continue.

In accordance with an embodiment, the list of data types to be droppedby the exporting peer 101 when exporting a set of database changes isspecified in the ontology map 110 using the following XML syntax:

<droppedUri>

<systemId>SYSTEM_ID</systemId>

<uri>URI1</uri>

</droppedUri>

<droppedUri>

<systemId>SYSTEM_ID</systemId>

<uri>URI2</uri>

</droppedUri>

. . .

<droppedUri>

<systemId>SYSTEM_ID</systemId>

<uri>URIN</uri>

</droppedUri>

The <droppedUri> element contains a data type to drop on export. The<systemId> element contains a value SYSTEM_ID that identifies the sitethat is to drop the listed data type when exporting. An ontology map 110can specify multiple drop data types lists for multiple sites. Forexample, ontology map 110 may specify a drop data types list for site101 and another drop data types list for site 102. Each site separatelyconsults its list in the map 110 when exporting a set of databasechanges. Each data type to be dropped is identified as a value of a<uri> element. In one embodiment, the value of a <uri> element is aUniform Resource Indicator (URI) that uniquely identifies the data typewithin the exporting site's ontology. Dropped types can include objecttypes, property types, and link types, for example.

One-to-One Mapping

In one embodiment, the ontology map 110 specifies a one-to-one data typemapping. In a one-to-one data type mapping, a single data type from theexporting peer's ontology 105 is mapped to a single data type in theimporting peer's ontology 106. In an embodiment, a one-to-one mapping isspecified using the following syntax:

<oneToOneMapping mappingType=“[link|object|property]”>

<uri>URI1</uri>

<uri>URI2</uri>

</oneToOneMapping>

In the above example mapping specification, the mappingType attribute ofthe <oneToOneMapping> element specifies whether the mapping applies to alink type, an object type, or a property type. The order of the <uri>child elements of the <oneToOneMapping> element corresponds to the orderof the <systemId> child elements of the <peerinformation> element. Thus,URI1 is a data type defined in SYSTEM_ID1's ontology and URI2 is a datatype defined in SYSTEM_ID2's ontology. Further, URI1 and URI2 should befor the same mappingType (i.e., link, object, or property). For example,if the mappingType specifies that the one-to-mapping applies to a“property”, then both URI1 and URI2 should be a property data type. Asused herein, URI refers to Uniform Resource Indicator. In oneembodiment, a URI is a string that uniquely identifies a data typewithin an ontology. In one embodiment, a oneToOneMapping isbi-directional. For example, URI1 will be mapped to URI2 when SYSTEM_ID2is the importing peer and URI2 will be mapped to URI1 when SYSTEM_ID1 isthe importing peer.

One-to-One Mapping With Reverse Link Feature

In one embodiment in which a one-to-one mapping is specified for a linkmapping type, the importing peer 102 reverses a link connecting two dataobjects represented by link data 631 in the database update 601 beforeimporting the link data 631 into the importing peer's database copy 104.Such a mapping may be useful if opposite asymmetrical link types aredefined in two peering ontologies. For example, the exporting peer'sontology 105 may define a “Parent Of” link type but not define a “ChildOf” link type while the importing peer's ontology 106 may define a“Child Of” link type but not define a “Parent Of” link type. If theimporting peer 102 mapped the “Parent Of” link to the “Child Of” linkwithout reversing the link represented by the link data 631 beforeimporting the link data 631 into the importing peer's database copy 104,then, after the import, “Child Of” links 202 connecting data objects 201in the importing peer's database copy 104 would incorrectly reflect thedirection of the child of relationship between the data objects.

In accordance with one embodiment, the following syntax is used in theontology map 110 to specify a one-to-one mapping with reversed links:

<oneToOneMapping mappingType=“link” reverseLink=“true”>

<uri>URI1</uri>

<uri>URI2</uri>

</oneToOneMapping>

One-to-Many Mapping

In some ontologies, there is a hierarchy of object types available forclassifying (typing) data objects. For example, an ontology may define asuper-object type “Person” with sub-object types “Employee” and“Contractor”. The “Person” object type is referred to as a “super”object type and “Employee” and “Contractor” object types are referred toas “sub” object types because a data object of type “Employee” or type“Contractor” is also of type “Person” but a data object of type “Person”may not be of type “Employee” or type “Contractor”. Assume thishierarchy is defined in site A's ontology but that site B's ontologyonly defines the object type “Person” and does not define the objecttypes “Employee” and “Contractor”. Given these ontologies, afterexporting a data object O of object type “Employee” from the databasecopy at site A to site B, it may be desirable for site B, on import tomap object type “Employee” to object type “Person”. Further, when site Bexports data object O back to site A, it would desirable for site A onimport to map object type “Person” back to object type “Employee”, ifappropriate to do so (i.e., if the data type of object O has not changedin the meantime).

In an embodiment, the type of object O in site A's database copy isretained when site B exports object O back to site A if the type ofobject O in site A's database copy is, according to the ontology map, achild type of the type of object O as exported by site B. For example,if site B exports object O as type “Person” and in site A's databasecopy object O has type “Employee”, then site A will retain type“Employee” for object O in its database copy provided the ontology mapspecifies that the “Employee” type is a child type of the “Person” type.Note that the specification of a parent and child types in a one-to-manymapping in the ontology map is independent of whether those types aresuper and sub-types according to the parent site ontology or the childsite ontology. For example, the “Employee” type may be specified as achild type of type “Person” in a one-to-many mapping yet the “Employee”type may not be defined as a sub-type of type “Person” in either siteA's ontology or site B's ontology.

In accordance with an embodiment, a one-to-many mapping is specified inan ontology map using the following syntax:

<oneToManyMapping mappingType=“[link|object|property]”>

<parentSystemId>SYSTEM_ID</parentSystemId>

<parentUri>PARENT_URI</parentUri>

<childUri>CHILD_URI1</childUri>

<childUri>CHILD_URI2</childUri>

. . .

</oneToManyMapping>

In this example, SYSTEM_ID is one of the two system identifiersspecified in the peer information section of the ontology map. TheSYSTEM_ID site (parent site) defines the PARENT_URI type in its ontology(e.g., site B defines type “Person”). The other site specified in thepeer information section defines at least all of the CHILD_URI types(e.g., site A defines types “Employee” and “Contractor”).

Before importing an object (e.g., object O) exported from the parentsite (e.g., Site B) into the child site's (e.g., Site A) database copy,a check is performed by the child site. In particular, the child sitechecks that the type of the object as stored in the child site'sdatabase copy is, according to the one to many mapping in the ontologymap, a child type of the type exported from the parent site. Forexample, if object O as stored in the Site A's database copy is of type“Employee” and Site B exports object O as type “Person”, then, beforeimporting object O as exported by Site B into Site A's database copy,Site A will check that type “Employee” is, according to the one to manymapping, a child type of type “Person”. If it is, then the “Employee”type for object O in Site A's database copy will be retained during theimport even though object O was exported from Site B as type “Person”.Otherwise, Site A will set the type of object O in Site A's databasecopy to be type exported by Site B (e.g., “Person”).

The PARENT_URI type need not be defined by the child site's ontology.For example, type “Person” may be, defined by Site A's ontology. Onimport, the child site can compare (e.g., by a string comparison) thedata type 632 specified in the update item 621 to the PARENT_URI type ofthe one-to-many mapping to determine if the mapping applies to theupdate item 621. In this case where the PARENT_URI type is not definedin the child site's ontology, the ontology map may specify a one to onemapping for the PARENT_URI type as a fallback mapping in the event adata type 632 of type PARENT_URI cannot be mapped under the one to manymapping to a CHILD_URI type. For example, if the type of object O inSite A's database copy before import is neither “Employee” nor“Contractor” and object O is exported from Site B as type “Person”, thenSite A, on import, may fallback to a one to one mapping in order to maptype “Person” to another type defined in Site A's ontology.

A one-to-many mapping can be applied to links and objects independent ofwhether hierarchical types are supported by the ontology. In particular,a one-to-many mapping may be used to retain the type of an object,property, or link in the child site's database copy when the object isexported back to the child site from the parent site irrespective ofwhether the parent site's ontology or the child site's ontology definesthe retained type as a sub-type of the exported type.

Further, a one-to-many mapping can be applied to any type hierarchy. Asan example, suppose a V→W→X1→X2→Y→Z (parent child) object type hierarchyexists in site A's ontology. Further assume the following one-to-manymapping in which site A is the child system and a site B is the parentsystem:

<oneToManyMapping mappingType=“[link|object|property]”>

<parentSystemId>SYSTEM_ID</parentSystemId>

<parentUri>W</parentUri>

<childUri>Y</childUri>

</oneToManyMapping>

Under this mapping, there are many possible type relationships betweenan object O's original type T at site A and object O's type T′ asexported back to site A from site B. If T′ is type W and T is type Y,then in accordance with one embodiment, site A should retain the morespecific type on import (i.e., type Y). However, if type T′ is asub-type of W (e.g., T′ is type X1) or a super-type of W (e.g., T′ istype V), then in accordance with one embodiment site A assumes that thetype for object O was changed at site B and thus does not retain theexisting type for object O in site A's database copy on import.

Pre-Export Peer Ontology Validation

In one embodiment as shown in FIG. 3, a property type 316 of an ontologyspecifies a base or primitive type 320 (e.g., string, number, etc.) andone or more components 318 that accept an input property value 300 andtransforms it in different ways to produce a final property value thatis stored in the database copy as the property value. For example, acomponent 318 of a “Phone Number” property type could employ a parser302 (e.g., a regular expression parser 304A or a code module parser304B) that attempts to format the raw input property value into a stringof the form “(XXX) XXX-XXXX”. Thus, the base type 320 and the components318 can be considered to be part of the ontology.

Two property types that are mapped to each other in an ontology map mayhave different base types 320 in different ontologies or employdifferent components 318 in different ontologies. For example, propertytype “com.siteA.PhoneNumber” as defined in site A's ontology may bemapped to property type “com.siteB.PhoneNumber” as defined in site B'sontology in an ontology map. Property type “com.siteA.PhoneNumber” asdefined in site A's ontology may have a number base type 320 whileproperty type “com.siteB.PhoneNumber” as defined in site B's ontologymay have a string base type 320. Even where mapped property types havethe same base type 320, the respective types may have differingcomponents 318 in different ontologies. For example, in site A'sontology, property type “com.siteA.PhoneNumber” may have a component 318that attempts to format (parse) raw input values into a string of theform “(XXX) XXX-XXXX” while, in site B′ ontology, property type“com.siteB.PhoneNumber” may have a component 318 that attempts to format(parse) raw input values into a string of the form “XXXXXXXXXX”.

Differences in base types 320 and differences in components 318 betweenontologies, even where the ontology map specifies a mapping betweenproperty types, can cause import errors at the importing peer. As oneexample, two mapped property types can have incompatible base types. Forexample, if property type “com.siteA.PhoneNumber” in site A's ontologyhas a string base type and property type “com.siteB.PhoneNumber” in siteB's ontology, to which property type “com.siteA.PhoneNumber” is mappedin the ontology map, has a number base type, then site B may not be ableto import data exported by site A of type “com.siteA.PhoneNumber” if theexported data cannot be converted at site B from a string to a number.

In accordance with one embodiment, the exporting peer performspre-export validation on properties to be exported using the importingpeer's ontology. By doing so, importing errors at the importing peerresulting from mapped property types having differing base types 302 ordiffering components 318 can be avoided.

Referring now to FIG. 7, a method 700 provides pre-export peer ontologyvalidation according to an embodiment. Method 700 is performed by theimport/export logic 120 of the exporting peer 101 prior to exporting aset of database changes 620 in which one or more of the set of databasechanges 620 to be exported are for properties 203. For example, steps ofmethod 700 might be performed after the exporting peer 101 has updatedthe value of a phone number property 203 in the exporting peer'sdatabase copy 103 and is now about to export the updated phone numberproperty to the importing peer 102. The basic approach of method 700 isto simulate, prior to exporting a database update 621 for a property203, how a given property value of the property 203 would changeaccording to the exporting peer ontology 105 and the importing peerontology 106 when the given property value is exported to the importingpeer 102 and back to the exporting peer 101. In other words, the basicapproach of method 700 is to simulate how the given property value wouldchange when making a replication round-trip from the original exportingpeer 101 to the importing peer 102 and back to the original exportingpeer 101. If the given property would not change after one round-trip orif the given property value would stabilize after two round trips, thenthe given property value can be safely exported from the exporting peer101 to the importing peer 102 even if the respective property typedefinitions in the respective ontologies 105 and 106 differ in base type320 or components 316.

At step 701, the exporting peer 101 obtains the importing peer'sontology 106. In one embodiment, the exporting peer 101 is configuredwith the importing peer's ontology 106 at the same time it is configuredwith the ontology map 110.

At step 702, the exporting peer 101 obtains a property value to beexported to the importing peer 102. For example, the exporting peer 101may obtain the property value as part of step 401 of FIG. 4 in which theexporting peer 101 determines a set of database changes 620 to sharewith the importing peer 102.

At step 703, the exporting peer 101 maps the property value according tothe importing peer's ontology 106 to an intermediate value and maps theintermediate value according to exporting peer's ontology 105 to obtaina first round-trip value. The first-round trip value represents how theproperty value to be exported would change if exported to the importingpeer, incorporated into the importing peer's database copy 104 accordingto the importing peer's ontology 106, and the incorporated valueexported back to the exporting peer 101 and incorporated back into theexporting peer's database copy 103 according to the exporting peer'sontology 105. This mapping includes mapping the property type 316 of theproperty value according to the exporting peer's ontology 105 to aproperty type 316 in the importing peer's ontology 106, using theontology map 110 if necessary. The original property value to beexported is then transformed according to the base type 320 and anycomponents 318 defined by the property type 316 of the property in theimporting peer's ontology 106 to produce the intermediate value. Forexample, if the base type 320 defined by the property type 316 of thevalue in the importing peer's ontology 106 is a number, then theexporting peer 101 will attempt to convert (cast) the original propertyvalue to a number. The intermediate value is then transformed accordingto the base type 320 and any components 318 defined by the property type316 of the property in the exporting peer's ontology 105 to produce thefirst round-trip value. For example, if the base type 320 defined by theproperty type 316 of the property in the exporting peer's ontology 105is a string, then the exporting peer 101 will attempt to convert (cast)the intermediate value to a string.

At step 704, the original property value to be exported is compared tothe first round-trip value. If they are the same, then the property canbe safely exported to the importing peer and the exporting peer 101 doesso at step 705. If they are not the same or an error occurred insimulating the first round-trip, then the mapping in the ontology map110 for the property may be incompatible. If an error did not occur inproducing the first round-trip value but the original property value andthe first round-trip value are not the same, the property may still besafely exported provided the property value will eventually stabilizeover multiple round trips. For example, consider a “Name” property type316 defined in the importing peer's ontology 106 of a string base type320 that has a component 318 that prepends the string “Mr.” if the valueof the property is determined to be a male name and prepends the string“Ms.” if the value of the property is determined to be a female name.Further assume that the component 318 will not prepend “Mr.” or “Ms.” ifone of those honorifics is already prepended. In this example, aproperty value that is originally exported as “John Smith” willeventually stabilize to “Mr. John Smith” after two round trips.Accordingly, in one embodiment, the exporting peer 101, when the firstround trip value does not match the original property value, simulates asecond round-trip at step 706. If, at step 707, the second round-tripvalue matches the first round-trip value, then the database change canbe safely exported to the importing peer 102 and at step 708 theexporting peer 101 exports the database change. Otherwise, the exportingpeer 101 at step 709 determines that there is an incompatible typemapping for the property in the ontology map 110.

Implementing Mechanisms—Hardware Overview

According to one embodiment, the techniques described herein areimplemented by one or more special-purpose computing devices. Thespecial-purpose computing devices may be hard-wired to perform thetechniques, or may include digital electronic devices such as one ormore application-specific integrated circuits (ASICs) or fieldprogrammable gate arrays (FPGAs) that are persistently programmed toperform the techniques, or may include one or more general purposehardware processors programmed to perform the techniques pursuant toprogram instructions in firmware, memory, other storage, or acombination. Such special-purpose computing devices may also combinecustom hard-wired logic, ASICs, or FPGAs with custom programming toaccomplish the techniques. The special-purpose computing devices may bedesktop computer systems, portable computer systems, handheld devices,networking devices or any other device that incorporates hard-wiredand/or program logic to implement the techniques.

For example, FIG. 8 is a block diagram that illustrates a computersystem 800 upon which an embodiment may be implemented. Computer system800 includes a bus 802 or other communication mechanism forcommunicating information, and a hardware processor 804 coupled with bus802 for processing information. Hardware processor 804 may be, forexample, a general purpose microprocessor.

Computer system 800 also includes a main memory 806, such as a randomaccess memory (RAM) or other dynamic storage device, coupled to bus 802for storing information and instructions to be executed by processor804. Main memory 806 also may be used for storing temporary variables orother intermediate information during execution of instructions to beexecuted by processor 804. Such instructions, when stored in storagemedia accessible to processor 804, render computer system 800 into aspecial-purpose machine that is customized to perform the operationsspecified in the instructions.

Computer system 800 further includes a read only memory (ROM) 808 orother static storage device coupled to bus 802 for storing staticinformation and instructions for processor 804. A storage device 810,such as a magnetic disk or optical disk, is provided and coupled to bus802 for storing information and instructions.

Computer system 800 may be coupled via bus 802 to a display 812, such asa cathode ray tube (CRT), for displaying information to a computer user.An input device 814, including alphanumeric and other keys, is coupledto bus 802 for communicating information and command selections toprocessor 804. Another type of user input device is cursor control 816,such as a mouse, a trackball, or cursor direction keys for communicatingdirection information and command selections to processor 804 and forcontrolling cursor movement on display 812. This input device typicallyhas two degrees of freedom in two axes, a first axis (e.g., x) and asecond axis (e.g., y), that allows the device to specify positions in aplane.

Computer system 800 may implement the techniques described herein usingcustomized hard-wired logic, one or more ASICs or FPGAs, firmware and/orprogram logic which in combination with the computer system causes orprograms computer system 800 to be a special-purpose machine. Accordingto one embodiment, the techniques herein are performed by computersystem 800 in response to processor 804 executing one or more sequencesof one or more instructions contained in main memory 806. Suchinstructions may be read into main memory 806 from another storagemedium, such as storage device 810. Execution of the sequences ofinstructions contained in main memory 806 causes processor 804 toperform the process steps described herein. In alternative embodiments,hard-wired circuitry may be used in place of or in combination withsoftware instructions.

The term “non-transitory media” as used herein refers to any media thatstore data and/or instructions that cause a machine to operation in aspecific fashion. Such non-transitory media may comprise non-volatilemedia and/or volatile media. Non-volatile media includes, for example,optical or magnetic disks, such as storage device 810. Volatile mediaincludes dynamic memory, such as main memory 806. Common forms ofnon-transitory media include, for example, a floppy disk, a flexibledisk, hard disk, solid state drive, magnetic tape, or any other magneticdata storage medium, a CD-ROM, any other optical data storage medium,any physical medium with patterns of holes, a RAM, a PROM, and EPROM, aFLASH-EPROM, NVRAM, any other memory chip or cartridge.

Non-transitory media is distinct from but may be used in conjunctionwith transmission media. Transmission media participates in transferringinformation between non-transitory media. For example, transmissionmedia includes coaxial cables, copper wire and fiber optics, includingthe wires that comprise bus 802. Transmission media can also take theform of acoustic or light waves, such as those generated duringradio-wave and infra-red data communications.

Various forms of media may be involved in carrying one or more sequencesof one or more instructions to processor 804 for execution. For example,the instructions may initially be carried on a magnetic disk or solidstate drive of a remote computer. The remote computer can load theinstructions into its dynamic memory and send the instructions over atelephone line using a modem. A modem local to computer system 800 canreceive the data on the telephone line and use an infra-red transmitterto convert the data to an infra-red signal. An infra-red detector canreceive the data carried in the infra-red signal and appropriatecircuitry can place the data on bus 802. Bus 802 carries the data tomain memory 806, from which processor 804 retrieves and executes theinstructions. The instructions received by main memory 806 mayoptionally be stored on storage device 810 either before or afterexecution by processor 804.

Computer system 800 also includes a communication interface 818 coupledto bus 802. Communication interface 818 provides a two-way datacommunication coupling to a network link 820 that is connected to alocal network 822. For example, communication interface 818 may be anintegrated services digital network (ISDN) card, cable modem, satellitemodem, or a modem to provide a data communication connection to acorresponding type of telephone line. As another example, communicationinterface 818 may be a local area network (LAN) card to provide a datacommunication connection to a compatible LAN. Wireless links may also beimplemented. In any such implementation, communication interface 818sends and receives electrical, electromagnetic or optical signals thatcarry digital data streams representing various types of information.

Network link 820 typically provides data communication through one ormore networks to other data devices. For example, network link 820 mayprovide a connection through local network 822 to a host computer 824 orto data equipment operated by an Internet Service Provider (ISP) 826.ISP 826 in turn provides data communication services through the worldwide packet data communication network now commonly referred to as the“Internet” 828. Local network 822 and Internet 828 both use electrical,electromagnetic or optical signals that carry digital data streams. Thesignals through the various networks and the signals on network link 820and through communication interface 818, which carry the digital data toand from computer system 800, are example forms of transmission media.

Computer system 800 can send messages and receive data, includingprogram code, through the network(s), network link 820 and communicationinterface 818. In the Internet example, a server 830 might transmit arequested code for an application program through Internet 828, ISP 826,local network 822 and communication interface 818.

The received code may be executed by processor 804 as it is received,and/or stored in storage device 810, or other non-volatile storage forlater execution.

In the foregoing specification, embodiments have been described withreference to numerous specific details that may vary from implementationto implementation. Thus, the sole and exclusive indicator of what is theinvention, and is intended by the applicants to be the invention, is theset of claims that issue from this application, in the specific form inwhich such claims issue, including any subsequent correction. Anydefinitions expressly set forth herein for terms contained in suchclaims shall govern the meaning of such terms as used in the claims.Hence, no limitation, element, property, feature, advantage or attributethat is not expressly recited in a claim should limit the scope of suchclaim in any way. The specification and drawings are, accordingly, to beregarded in an illustrative rather than a restrictive sense.

What is claimed is:
 1. A method comprising: modeling for implementingobject-centric data models; obtaining, at an importing site, anexporting site ontology and a set of one or more database changesassociated with an exporting site; wherein the exporting site ontologydefines one or more first object types and one or more first link typesrelating two or more objects of the one or more first object types in afirst object-centric data model; obtaining an ontology map comprising atleast one object rule for mapping the one or more first object types ofthe first object-centric data model one or more second object types in asecond object-centric data model defined by an importing site ontologyand at least one link rule for mapping the one or more first link typesof the first object-centric data model to one or more second link typesin the second object-centric data model; incorporating the set of one ormore database changes into a database at the importing site based on theat least one object rule and the at least one link rule, wherein atleast one link represented in the set of one or more database changes isreversed based on the at least one link rule; wherein object data for atleast one object is represented by different object types in the firstobject-centric data model and the second object-centric data model;wherein the method is performed by one or more computing devices.
 2. Themethod of claim 1, wherein at least one database change of the set ofone or more database changes comprises (a) a data item representing achange to a database copy at the exporting site and (b) datarepresenting an object type of the data item according to the exportingsite ontology.
 3. The method of claim 1, wherein obtaining, at theimporting site, the exporting site ontology and the set of one or moredatabase changes comprises obtaining, at the importing site, a databaseupdate comprising the exporting site ontology and the set of one or moredatabase changes.
 4. The method of claim 1, further comprising:obtaining, at the importing site, a digest of an ontology map at theexporting site; computing a digest of an ontology map at the importingsite; comparing the obtained digest of the ontology map at the exportingsite with the computed digest of the ontology map at the importing site.5. The method of claim 1, wherein the ontology map comprises aone-to-one mapping between a first particular data type defined by theexporting site ontology and a second particular data type defined by theimporting site ontology; and wherein incorporating the set of one ormore database changes into a database at the importing site based on theat least one object rule comprises mapping the first particular datatype to the second particular data type using the ontology map.
 6. Themethod of claim 1, wherein the ontology map comprises a one-to-manymapping between a first particular data type defined by the exportingsite ontology and a plurality data types defined by the importing siteontology; and wherein incorporating the set of one or more databasechanges into a database at the importing site based on the at least oneobject rule comprises mapping the first particular data type to one ofthe plurality of data types defined by the importing site ontology usingthe ontology map.
 7. The method of claim 1, wherein the ontology mapspecifies a list of data types to be dropped when exporting databasechanges from the exporting site.
 8. The method of claim 1, wherein theontology map comprises a one-to-one mapping between a first particularlink data type defined by the exporting site ontology and a secondparticular link data type defined by the importing site ontology;wherein a particular rule of the at least one link rule furtherspecifies that a link represented by data of the first particular linkdata type should be reversed before data representing the link isincorporated into the database; wherein incorporating the set of one ormore database changes into the database comprises reversing a linkrepresented by a particular database change of the set of databasechanges before incorporating the particular database change into thedatabase.
 9. A system comprising: models for implementing object-centricdata models; one or more processors; one or more non-transitory computerreadable storage media; and logic configured for: obtaining, at animporting site, an exporting site ontology and a set of one or moredatabase changes associated with an exporting site; wherein theexporting site ontology defines one or more first object types and oneor more first link types relating two or more objects of the one or morefirst object types in a first object-centric data model; obtaining anontology map comprising at least one rule for mapping the one or morefirst object types of the first object-centric data model to one or moresecond object types and one or more second link types in a secondobject-centric data model defined by an importing site ontology and atleast one link rule for mapping the one or more first link types of thefirst object-centric data model to one or more second link types in thesecond object-centric data model; incorporating the set of one or moredatabase changes into a database at the importing site based on the atleast one object rule and the at least one link rule, wherein at leastone link represented in the set of one or more database changes isreversed based on the at least one rule; wherein object data for atleast one object is represented by different object types in the firstobject-centric data model and the second object-centric data model. 10.The system of claim 9, wherein at least one database change of the setof one or more database changes comprises (a) a data item representing achange to a database copy at the exporting site and (b) datarepresenting an object type of the data item according to the exportingsite ontology.
 11. The system of claim 9, wherein obtaining, at theimporting site, the exporting site ontology and the set of one or moredatabase changes comprises obtaining, at the importing site, a databaseupdate comprising the exporting site ontology and the set of one or moredatabase changes.
 12. The system of claim 9, further comprising logicfor: obtaining, at the importing site, a digest of an ontology map atthe exporting site; computing a digest of an ontology map at theimporting site; comparing the obtained digest of the ontology map at theexporting site with the computed digest of the ontology map at theimporting site.
 13. The system of claim 9, wherein the ontology mapcomprises a one-to-one mapping between a first particular data typedefined by the exporting site ontology and a second particular datadefined by the importing site ontology; and wherein incorporating theset of one or more database changes into a database at the importingsite based on the at least one object rule comprises mapping the firstparticular data type to the second particular data type using theontology map.
 14. The system of claim 9, wherein the ontology mapcomprises a one-to-many mapping between a first particular data typedefined by the exporting site ontology and a plurality of data typesdefined by the importing site ontology; and wherein incorporating theset of one or more database changes into a database at the importingsite based on the at least one object rule comprises mapping the firstparticular data type to one of the plurality of data types defined bythe importing site ontology using the ontology map.
 15. The system ofclaim 9, wherein the ontology map specifies a list of data types to bedropped when exporting database changes from the exporting site.
 16. Thesystem of claim 9, wherein the ontology map comprises a one-to-onemapping between a first particular link data type defined by theexporting site ontology and a second particular link data type definedby the importing site ontology; wherein a particular rule of the atleast one link rule further specifies that a link represented by data ofthe first particular link data type should be reversed before datarepresenting the link is incorporated into the database; whereinincorporating the set of one or more database changes into the databasecomprises reversing a link represented by a particular database changeof the set of database changes before incorporating the particulardatabase change into the database.
 17. A non-transitory computerreadable medium storing computer-executable instructions which, whenexecuted by one or more processors, cause the one or more processors tocarry out steps comprising: modeling for implementing for object-centricdata models; obtaining, at an importing site, an exporting site ontologyand a set of one or more database changes associated with an exportingsite; wherein the exporting site ontology defines one or more firstobject types and one or more first link types relating two or moreobjects of the one or more first object types in a first object-centricdata model; obtaining an ontology map comprising at least one objectrule for mapping the one or more first object types of the firstobject-centric data model to one or more second object types in a secondobject-centric data model defined by an importing site ontology and atleast one link rule for mapping the one or more first link types of thefirst object-centric data model to one or more second link types in thesecond object-centric data model; incorporating the set of one or moredatabase changes into a database at the importing site based on the atleast one object rule and the at least one link rule, wherein at leastone link represented in the set of one or more database changes isreversed based on the at least one link rule; wherein object data for atleast one object is represented by different object types in the firstobject-centric data model and the second object-centric data model. 18.The non-transitory computer readable medium of claim 17, wherein atleast one database change of the set of one or more database changescomprises (a) a data item representing a change to a database copy atthe exporting site and (b) data representing an object type of the dataitem according to the exporting site ontology.
 19. The non-transitorycomputer readable medium of claim 17, wherein obtaining, at theimporting site, the exporting site ontology and the set of one or moredatabase changes comprises obtaining, at the importing site, a databaseupdate comprising the exporting site ontology and the set of one or moredatabase changes.
 20. The non-transitory computer readable medium ofclaim 17, the steps further comprising: obtaining, at the importingsite, a digest of an ontology map at the exporting site; computing adigest of an ontology map at the importing site; comparing the obtaineddigest of the ontology map at the exporting site with the computeddigest of the ontology map at the importing site.
 21. The non-transitorycomputer readable medium of claim 17 the steps further comprising,wherein the ontology map comprises a one-to-one mapping between a firstparticular data type defined by the exporting site ontology and a secondparticular data type defined by the importing site ontology; and whereinincorporating the set of one or more database changes into a database atthe importing site based on the at least one object rule comprisesmapping the first particular data type to the second particular datatype using the ontology map.
 22. The non-transitory computer readablemedium of claim 17, wherein the ontology map comprises a one-to-manymapping between a first particular data type defined by the exportingsite ontology and a plurality data types defined by the importing siteontology; and wherein incorporating the set of one or more databasechanges into a database at the importing site based on the at least oneobject rule comprises mapping the first particular data type to one ofthe plurality of data types defined by the importing site ontology usingthe ontology map.
 23. The non-transitory computer readable medium ofclaim 17, wherein the ontology map specifies a list of data types to bedropped when exporting database changes from the exporting site.
 24. Thenon-transitory computer readable medium of claim 17, wherein theontology map comprises a one-to-one mapping between a first particularlink data type defined by the exporting site ontology and a secondparticular link data type defined by the importing site ontology;wherein a particular rule of the at least one link rule furtherspecifies that a link represented by data of the first particular linkdata type should be reversed before data representing the link isincorporated into the database; wherein incorporating the set of one ormore database changes into the database comprises reversing a linkrepresented by a particular database change of the set of databasechanges before incorporating the particular database change into thedatabase.